package com.ruoyi.system.mapper;

import com.ruoyi.system.domain.SalesOrder;
import com.ruoyi.system.domain.SalesOrderItems;

import java.util.List;

public interface SalesOrderMapper {

    List<SalesOrder> selectSalesOrderList(SalesOrder salesOrder);

    SalesOrder selectSalesOrderById(Long salesOrderId);

    Long getPendingApprovalNodeId(long l);

    int insertSalesOrder(SalesOrder salesOrder);

    /**
     * 删除销售单
     */
    int deleteSalesOrderById(Long salesOrderId);

    /**
     * 批量删除销售单
     */
    int deleteSalesOrderByIds(Long[] salesOrderIds);

    /**
     * 更新销售单
     */
    int updateSalesOrder(SalesOrder salesOrder);

    List<SalesOrderItems> selectSalesOrderItemsByOrderId(Long salesOrderId);

    int insertSalesOrderItems(SalesOrderItems salesOrderItem);

    void deleteSalesOrderItemsByOrderId(Long salesOrderId);

    int batchInsertSalesOrderItems(List<SalesOrderItems> items);

    /**
     * 获取指定前缀的最大编号
     */
    public String getMaxNumberByPrefix(String prefix);

    /**
     * 根据订单编号查询销售单
     */
    public SalesOrder selectSalesOrderByNumber(String number);

    /**
     * 查询待审批的销售单列表
     */
    public List<SalesOrder> selectPendingSalesOrders();
}
